home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / qwindows.arc / MAKSND.8 < prev    next >
Encoding:
Text File  |  1987-04-03  |  960 b   |  37 lines

  1. Name      Maksnd         ;Name of module used at link time
  2. Public    Maksnd         ;Only the start name is public
  3.  
  4. Maksnd:   org  0
  5.  
  6. Thi       equ  700
  7. Tlo       equ  150
  8. Wait1     equ  2000
  9.  
  10.           in   al,61h    ;Get enable byte
  11.           or   al,3      ;Enable sound
  12.           out  61h,al
  13.  
  14.           mov  ax,Thi    ;Get lowest tone count
  15. Y1:       push ax        ;Save count
  16.           mov  al,0B6h   ;Tell timer data is coming
  17.           out  43h,al
  18.           pop  ax
  19.           push ax
  20.           out  42h,al    ;Send count to timer
  21.           mov  al,ah     ;low byte first
  22.           out  42h,al
  23.  
  24.           mov  cx,Wait1  ;Delay a while
  25. Y2:       nop
  26.           loop Y2
  27.  
  28.           pop  ax        ;Get count
  29.           sub  ax,50     ;Make freq higher
  30.           cmp  ax,Tlo    ;Highest freq?
  31.           ja   Y1        ;No
  32.  
  33.           in   al,61h    ;Disable sound
  34.           and  al,0FCh
  35.           out  61h,al
  36.           retf
  37.